<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFinancialIncomingsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('financial_incoming', function(Blueprint $table)
		{
			$table->increments('id');
			$table->timestamps();
			//关联tyw_financing
			$table->integer('financing_id');
			// double 营业成本
			$table->double('cost',13,2);
			// double 营业税金及附加
			$table->double('business_tax',13,2);
			// double 销售费用
			$table->double('sell_cost',13,2);
			// double 管理费用
			$table->double('manage_cost',13,2);
			// double 财务费用
			$table->double('financial_cost',13,2);
			// double 资产减值损失
			$table->double('assets_loss',13,2);
			// double 公允价值变动净收益
			$table->double('fair_value_earn',13,2);
			// double 投资净收益
			$table->double('investment_earn',13,2);
			// double 对联营企业与合营企业的投资收益
			$table->double('union_investment_earn',13,2);
			// double 营业外收入
			$table->double('addition_earn',13,2);
			// double 营业外支付
			$table->double('addition_cost',13,2);
			// double 非流动资产处置净损失
			$table->double('not_flow_cost',13,2);
			// double 所得税
			$table->double('income_tax',13,2);
			// double 净利润
			$table->double('pure_earn',13,2);
			// double 基本每股收益
			$table->double('earn_per_stock_base',13,2);
			// double 稀释每股收益
			$table->double('earn_per_stock_dilution',13,2);
			// tinyint 2    0为本月数 1为本年累计数
			$table->tinyInteger('type');

			$table->softDeletes();

		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('financial_incomings');
	}

}
